import {ref} from "vue";

export const pigPricePublishCntOptions = ref({
  title: {
    text: "全国不同省份价格发布数量分布",
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
})

export const pigPriceLocateOptions = ref({
  title: {
    text: "全国不同省份价格分布",
    left: 'center'
  },
  tooltip: {
    trigger: 'axis',  // 'axis'表示坐标轴触发，主要在柱状图、折线图等会使用类目轴的图表中使用
    axisPointer: {
      type: 'cross'  // 设置为直角坐标轴类型的指针
    }
  },
  xAxis: {
    axisLabel: {
      margin: 20, // 设置标签间距，可根据实际需要调整
      textStyle: { // 设置文本样式，包括字体、大小、颜色等
        color: '#333', // 设置字体颜色为深灰色，可根据实际需要调整
        fontSize: 10, // 设置字体大小为 12px，可根据实际需要调整
      },
    },
    data: []
  },
  yAxis: {},
  series: [
    {
      data: [],
      type: 'candlestick',
    }
  ]
})

export const provinceAverageMaxPriceOptions = ref(
  {
    title: {
      text:
        '全国省份平均价格',
      left: 'center'
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    legend: {},
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    xAxis: {
      type: 'value',
      boundaryGap: [0, 0.01]
    },
    yAxis: {
      type: 'category',
      data: []
    },
    series: [
      {
        type: 'bar',
        data: [],
        label: {
          show: true, // 显示标签
          position: 'insideRight', // 标签位置
          formatter: '{b}: {c}', // 标签内容，{b}表示name，{c}表示value
        },
      },
    ]
  })

export const provinceAverageMinPriceOptions = ref(
  {
    title: {
      text: '省平均价格最底前10'
    },
    tooltip: {
      trigger: 'axis'
    },
    legend: {
      data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    toolbox: {
      feature: {
        saveAsImage: {}
      }
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        name: 'Email',
        type: 'line',
        stack: 'Total',
        data: [120, 132, 101, 134, 90, 230, 210]
      },
      {
        name: 'Union Ads',
        type: 'line',
        stack: 'Total',
        data: [220, 182, 191, 234, 290, 330, 310]
      },
      {
        name: 'Video Ads',
        type: 'line',
        stack: 'Total',
        data: [150, 232, 201, 154, 190, 330, 410]
      },
      {
        name: 'Direct',
        type: 'line',
        stack: 'Total',
        data: [320, 332, 301, 334, 390, 330, 320]
      },
      {
        name: 'Search Engine',
        type: 'line',
        stack: 'Total',
        data: [820, 932, 901, 934, 1290, 1330, 1320]
      }
    ]

  })

export const provincePriceTrendOptions = ref(
  {
    title: {
      text: '最近一个月价格走势'
    },
    tooltip: {
      trigger: 'axis', // 设置触发类型为坐标轴
      axisPointer: {
        type: 'cross' // 设置提示线样式为十字准星
      }
    },
    legend: {
      data: ['最高价', '最低价', '平均价']
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    toolbox: {
      feature: {
        saveAsImage: {}
      }
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      data: []
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        name: '最高价',
        type: 'line',
        data: []
      },
      {
        name: '最低价',
        type: 'line',
        data: []
      },
      {
        name: '平均价',
        type: 'line',
        data: []
      },
    ]
  }
)

export const provinceWeekPriceTrendOptions = ref({
  title: {
    text: '最近一周价格走势'
  },
  legend: {},
  tooltip: {},
  dataset: {
    dimensions: ['product', 'max', 'min', 'average'],
    source: []
  },
  xAxis: {type: 'category'},
  yAxis: {},
  // Declare several bar series, each will be mapped
  // to a column of dataset.source by default.
  series: [{type: 'bar'}, {type: 'bar'}, {type: 'bar'}]
})








